const Router = require("koa-router");
const main = require("../../models");
const router = new Router();
const {ObjectId} = require("mongodb")
router.get("/doDelete",async ctx=>{
    console.log(ctx.query);
    var {_id,title} = ctx.query;
    var talbe = await main("top250");
    // var res = await talbe.deleteOne({title:title})
     var res = await talbe.deleteOne({_id:ObjectId(_id)})
    console.log(res);
    await ctx.redirect("/home")
})
module.exports = router;